package iterator.example;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author：LJ
 * @Description：
 * @Date: 2017/12/1
 * @Modified By:
 */
public class ProjectIterator implements IProjectIterator {
    private List<IProject> projectList = new ArrayList<IProject>();
    private int currentItem = 0;

    public ProjectIterator(List<IProject> projectList) {
        this.projectList = projectList;
    }

    @Override
    public boolean hasNext() {
        return currentItem >= projectList.size() || projectList.get(currentItem) == null ? false : true;
    }

    @Override
    public IProject next() {
        return projectList.get(currentItem++);
    }

    @Override
    public void remove() {

    }
}
